{% extends "bvblogapp/base.html" %}
{% load webdesign %}

{% block pageName %}BioVenturist - Test page{% endblock %}


{% block queryScript %}

<!--CSS file (default YUI Sam Skin) -->
<link type="text/css" rel="stylesheet" href="http://yui.yahooapis.com/2.8.0r4/build/datatable/assets/skins/sam/datatable.css" />
<link type="text/css" rel="stylesheet" href="/bvsearchapp/static/css/bvsearchapp.css" />
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.0r4/build/paginator/assets/skins/sam/paginator.css" />

<!-- Dependencies -->
<script type="text/javascript" src="http://yui.yahooapis.com/2.8.0r4/build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.8.0r4/build/element/element-min.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.8.0r4/build/datasource/datasource-min.js"></script>

<!-- OPTIONAL: JSON Utility (for DataSource) -->
<script type="text/javascript" src="http://yui.yahooapis.com/2.8.0r4/build/json/json-min.js"></script>

<!-- OPTIONAL: Connection Manager (enables XHR for DataSource) -->
<script type="text/javascript" src="http://yui.yahooapis.com/2.8.0r4/build/connection/connection-min.js"></script>

<!-- OPTIONAL: Get Utility (enables dynamic script nodes for DataSource) -->
<script type="text/javascript" src="http://yui.yahooapis.com/2.8.0r4/build/get/get-min.js"></script>

<script type="text/javascript" src="http://yui.yahooapis.com/2.8.0r4/build/paginator/paginator-min.js"></script>

<!-- Source files -->
<script type="text/javascript" src="http://yui.yahooapis.com/2.8.0r4/build/datatable/datatable-min.js"></script>

<!-- jQuery packed from Google CDN -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>

<!-- Freebase controls -->
<link type="text/css" rel="stylesheet" href="/static/css/freebase-controls.css" />
<script src="/static/js/freebase.suggest.js" type="text/javascript"></script>
<!-- Curvy corners jQuery plugin -->
<script type="text/javascript" src="/static/js/jquery.curvycorners.packed.js"></script>

<link href="/bvsearchapp/static/js/facebox.css" media="screen" rel="stylesheet" type="text/css"/>
<script src="/bvsearchapp/static/js/facebox.js" type="text/javascript"></script>


<script type="text/javascript">


function load_info(){return true};

var myolumnDefs = [
    { key: "fname", label: "First Name" },
    { key: "lname", label: "Last Name" },
    { key: "age", label: "Age" }
];


console.debug('fucj');
YAHOO.util.Event.addListener(window, "load", function() {
    console.debug('fuc222j');
    var element = YAHOO.util.Dom.getElementsByClassName('table')[0];
    console.debug(element);
    YAHOO.util.Dom.insertAfter('<b>hello</b>', element);
    var dsLocalTable = new YAHOO.util.LocalDataSource(YAHOO.util.Dom.get("r_table"));
    dsLocalTable.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
    dsLocalTable.responseSchema = {
        fields: new Array(),
    };

    var columnDefs = new Array()
    
    jQuery('#r_table thead tr th').each(function(){
        columnDefs.push( { key: $(this).text().replace(' ', ''), label: $(this).text()} )
        dsLocalTable.responseSchema.fields.push( { key: $(this).text().replace(' ', '') } )
        });

    ResultsDataTableDeferred = new YAHOO.widget.ScrollingDataTable(
        "results",
        columnDefs,
        dsLocalTable,
        {width: 400}
        );    
        
    });
</script>



{% endblock %}

{% block body_class %}yui-skin-sam{% endblock %}

{% block container %}

<div style="margin: 3em;">

	<p>I would like to say: </p>

  

    <table class="table" id="r_table">
        <thead>
            <tr>
                <th>Test 1</th>
                <th>Test 2</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>1 1</td>
                <td>1 2 </td>
            </tr>
            <tr>
                <td>2 1</td>
                <td>2 2</td>
            </tr>
        </tbody>  
    </table>    


    <div id="results"></div>
</div>
{% endblock %}
